import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class FileReaders {
    // 文件路径
    public String filePath = "";


    public String ReadFile(String filePath)
    {
        this.filePath=filePath;
        String result = "";
        try (java.io.FileReader fr = new FileReader(filePath);
             BufferedReader br = new BufferedReader(fr)) {

            int character;
            // 逐个字符读取
            while ((character = br.read()) != -1) {
                // 打印每个字符
                result += (char) character;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
}
